home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’93 / Hellcats FlightRecorder / StartRecording.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  1KB  |  50 lines

  1. #include "FlightRecorder.h"
  2.  
  3. void StartRecording(storage *s)
  4. {
  5.  
  6.     FSSpec    file;
  7.     OSErr    err;
  8.     short    saveResFile;
  9.     
  10.     s = GetStoragePtr();
  11.     s->fCount = 128;
  12.  
  13.  
  14.     /* create a file spec for the PICS file */
  15.     /* this puts it in the default directory, at least for me */
  16.     /* I tried to use StandardFile, but Ley does not process update events */
  17.     /* while playing a reply, and it trashed the animation */
  18.     /* I could have made this save and restore the bits */
  19.     /* but this works and after all, it is a hack */    
  20.     err = FSMakeFSSpec(0, 0, "\pInstant Reply",&file);
  21.                             
  22.     /* delete the one that was there */
  23.     /* if you liked it tooo bad!@ */
  24.     (void)FSpDelete(&file);
  25.     
  26.     /* save the application's resource chain because we */
  27.     /* are about to open another file on it and do not want to */
  28.     /* screw the app up */
  29.     saveResFile = CurResFile();
  30.     
  31.     /* create the PICS file */
  32.     FSpCreateResFile(&file, '????','PICS', -1);    // smSystemScript
  33.     if( err = ResError() ) {
  34.         DebugStr("\p FSpCreateResFile failed");
  35.     }
  36.     
  37.     /* and open it up */
  38.     s->ref = FSpOpenResFile(&file, fsRdWrPerm);
  39.     if(err = ResError() ) {
  40.         DebugStr("\p FSpOpen failed");
  41.     }
  42.  
  43.     /* put the chain back the way it was because */
  44.     /* saveAFrame also saves it */
  45.     UseResFile(saveResFile);
  46.  
  47.     /* take the first picture of the movie */
  48.     SaveAFrame(s);
  49. }
  50.